import 'package:taonile/http/request.dart';

///
/// 接口调用工具类
///
class Api {
  //============================登录/注册/用户
  //登录
  static login(data) => Request.post("/api/v1/auth/login", data: data);

  //注册
  static register(data) => Request.post("/api/v1/auth/register", data: data);

  //找回密码(也可以用来修改密码)
  static resetPwd(data) => Request.post("/api/v1/auth/resetPwd", data: data);

  //修改密码(主要是用来修改支付密码)
  static changePwd(data) => Request.post("/api/v1/user/changePassword", data: data);

  //退出登录
  static loginOut() => Request.post("/api/v1/auth/logout");

  //个人信息
  static getUserinfo() => Request.get("/api/v1/user/info");

  //我的团队
  static getMineTeam(data) => Request.get("/api/v1/user/team", data: data);

  //资产明细
  static getassetDetail(data) => Request.get("/api/v1/user/accountDetails", data: data);

  //我的邀请码
  static getMineCode() => Request.get("/api/v1/user/code");

  //更新个人信息
  static upUserinfo(data) => Request.post("/api/v1/user/profile", data: data);

  //判断是否设置支付密码
  static checkSetPayPwd() => Request.get("/api/v1/order/checkUserPayPwdExists");

  //获取隐私协议地址
  static privacyAgreement() => Request.get("/api/v1/index/privacyAgreement");

  //获取用户协议地址
  static userAgreement() => Request.get("/api/v1/index/userAgreement");

  //我的收藏列表
  static collectionList(data) => Request.get("/api/v1/user/collectionList", data: data);

  //转账
  static transfer(data) => Request.post("/api/v1/user/transfer", data: data);

  //兑换
  static exchange(data) => Request.post("/api/v1/user/exchange", data: data);

  //修改手机号
  static changeMobile(data) => Request.post("/api/v1/user/changeMobile", data: data);

  //发送短信验证码
  static sendSms(data) => Request.post("/api/v1/index/sendSms", data: data);

  //验证短信验证码，主要是修改手机要用
  static checkSms(data) => Request.post("/api/v1/index/check", data: data);

  //银行卡列表
  static bankCardList(data) => Request.get("/api/v1/account/list", data: data);

  //删除银行卡
  static deleteBankCard(data) => Request.get("/api/v1/account/delBank", data: data);

  //添加银行卡
  static addBankCard(data) => Request.post("/api/v1/account/bank", data: data);

  //更新银行卡
  static upBankCard(data) => Request.post("/api/v1/account/update", data: data);

  //申请提现
  static getCash(data) => Request.post("/api/v1/withdrawal/withdrawal", data: data);

  //提现记录列表
  static getCashRecord(data) => Request.get("/api/v1/withdrawal/list", data: data);

  //平台支持的银行列表
  static bankList() => Request.get("/api/v1/account/bankList");

  //申请入驻的类目列表
  static applyBusinessCategoryList(data) =>
      Request.get("/api/v1/business/categoryList", data: data);

  //申请入驻
  static applyBusiness(data) => Request.post("/api/v1/business/apply", data: data);

  //修改入驻
  static applyBusinessUpdate(data) => Request.post("/api/v1/business/editapply", data: data);

  //修改已入驻的店铺信息
  static businessUpdate(data) => Request.post("/api/v1/business/profile", data: data);

  // //入驻的店铺主体信息
  // static applyBusinessInfo() => Request.get("/api/v1/business/subjectInfo");

  //已入驻的店铺详情
  static businessDetail() => Request.get("/api/v1/business/shopInfo");

  //获取股票价格
  static stockInfo() => Request.get("/api/v1/tradingCentral/stockPrice");

  //兑换股票
  static stockExchange(data) => Request.post("/api/v1/tradingCentral/stockExchange", data: data);

  //获取币行情
  static coinMarketList() => Request.get("/api/v1/tradingCentral/price");

  //删除股票凭证
  static delCertificates() => Request.get("/api/v1/user/delCertificates");

  //股票七日价格列表
  static candlestick() => Request.get("/api/v1/tradingCentral/candlestick");


  //============================商城

  //商品分类列表
  static goodsCategoryList(data) => Request.post("/api/v1/goods/goodsCategoryList", data: data);

  //商品列表
  static goodsList(data) => Request.get("/api/v1/goods/goodsList", data: data);

  //商品专区分类列表
  static goodsAreaCategoryList() => Request.post("/api/v1/goods/goodsAreaCategoryList");

  //商品详情
  static goodsDetail(data) => Request.get("/api/v1/goods/goodsDetail$data");

  //店铺详情
  static storeDetail(data) => Request.get("/api/v1/store/storeDetail/$data");

  //添加收货地址
  static addReceipt(data) => Request.post("/api/v1/logistics/addReceipt", data: data);

  //删除收货地址
  static delReceipt(data) => Request.post("/api/v1/logistics/delReceipt", data: data);

  //更新收货地址
  static upReceipt(data) => Request.post("/api/v1/logistics/updateReceipt", data: data);

  //收货地址详情
  static receiptDetail(data) => Request.get("/api/v1/logistics/receiptDetail$data");

  //快递公司列表
  static expressNameList() => Request.get("/api/v1/logistics/expressList");

  //快递公司列表
  static expressMap(data) => Request.get("/api/v1/logistics/expressMap/$data");

  //收货地址列表
  static receiptList() => Request.post("/api/v1/logistics/receiptList");

  //商城首页轮播
  static bannerForHome(data) => Request.post("/api/v1/shopPages/bannerList",data:data);

  //商城金刚区
  static jingangForHome() => Request.get("/api/v1/shopPages/quickInList");

  //收藏商品或店铺
  static collection(data) => Request.post("/api/v1/store/collection", data: data);

  //商城的一个模块
  static goodsSourceList() => Request.get("/api/v1/goods/goodsSourceList");

  //添加购物车
  static addShoppingCar(data) => Request.post("/api/v1/businessCart/addCart", data: data);

  //购物车列表
  static shoppingCarList() => Request.post("/api/v1/businessCart/list");

  //修改购物车商品数量
  static upShoppingCar(data) => Request.post("/api/v1/businessCart/updateNum", data: data);

  //删除购物车商品
  static deleteShoppingCar(data) => Request.get("/api/v1/businessCart/del/$data");

  //============================订单

  //获取商品价格(确认下单)
  static confirmOrder(data) => Request.post("/api/v1/order/calcSkuPrice", data: data);

  //确认下单,单品下单
  static createOrder(data) => Request.post("/api/v1/order/createOrder", data: data);

  //确认下单,单品下单（新）
  static createOrderNew(data) => Request.post("/api/v1/businessOrder/addOrder", data: data);

  //确认下单,购物车下单（新）
  static createCarOrderNew(data) => Request.post("/api/v1/businessOrder/addCartOrder", data: data);

  //确认支付
  static orderPay(data) => Request.post("/api/v1/order/orderPay", data: data);

  //确认支付（新）
  static orderPayNew(data) => Request.post("/api/v1/businessOrder/pay", data: data);

  //订单详情
  static orderDetail(data) => Request.get("/api/v1/order/orderDetail/$data");

  //订单列表
  static orderList(data) => Request.post("/api/v1/order/orderList", data: data);

  //提醒发货
  static orderSendNotice(data) => Request.get("/api/v1/order/noticeSendGoods/$data");

  //取消订单原因列表
  static cancelOrderReason() => Request.get("/api/v1/order/cancelOrderReason");

  //取消订单
  static cancelOrder(data) => Request.get("/api/v1/order/cancelOrder/$data");

  //确认收货
  static orderReceipt(data) => Request.post("/api/v1/order/confirmReceipt", data: data);

  //获取支付配置
  static payMethods(data) => Request.get("/api/v1/order/selectPayChannel/$data");

  //发表评价
  static publishComment(data) => Request.post("/api/v1/order/comment", data: data);

  //申请退货退款补发原因列表
  static drawbackList(data) => Request.get("/api/v1/businessDrawback/drawbackList/$data");

  //退款服务类型
  static exchangeType() => Request.get("/api/v1/businessDrawback/exchangeType");

  //申请退货退款
  static applyRefund(data) => Request.post("/api/v1/businessDrawback/applyRefund", data: data);

  //退款单列表
  static refundOrderList(data) => Request.post("/api/v1/businessDrawback/list", data: data);

  //退款单详情
  static refundOrderDetail(data) =>
      Request.post("/api/v1/businessDrawback/alreadyGoodsDetails", data: data);

  //提交退货寄回的快递单
  static addExpress(data) => Request.post("/api/v1/businessDrawback/addExpress", data: data);

  // static alipayParam(data) => Request.post("/api/v1/order/alipay", data: data);

  //============================系统

  //系统公告列表
  static announcementList(data) => Request.get("/api/v1/index/list", data: data);

  //联系我们
  static contactUs() => Request.get("/api/v1/index/contactUs");

  //检测新版本
  static checkVersion(data) => Request.get("/api/v1/index/checkVersion", data: data);

  //获取系统参配，手续费之类的
  static getSystemConfig() => Request.get("/api/v1/index/config");

// //上传文件，图片
// static upLoadImg(String imgPath) {
//   return Request.fileUplod("/..",imgPath);
// }
}
